"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views

urlpatterns = [
    # 首页路由
    url(r'^$',  views.index,name="myhome_index"),
    #列表页
    url(r'^list/(?P<tid>[0-9]+)/$',  views.goodslist,name="myhome_list"),
    # 详情页
    url(r'^info(?P<gid>[0-9]+)/$',  views.goodsinfo,name="myhome_info"),


    # 登陆
    url(r'^login/$',  views.login,name="myhome_login"),
    # 退出登陆
    url(r'^logout/$',  views.logout,name="myhome_logout"),
    # 注册
    url(r'^register/$',  views.register,name="myhome_register"),
    # 验证码
    url(r'^verifycode/$',  views.verifycode,name="myhome_verifycode"),
    # 短信验证
    url(r'^sendmsg/$',  views.sendmsg,name="sendmsg"),


    # 购物车添加
    url(r'^cart/add/$',  views.cartadd,name="myhome_cartadd"),
    # 购物车添加
    url(r'^cart/index/$',  views.cartindex,name="myhome_cartindex"),
    # 购物车清空
    url(r'^cart/clear/$',  views.cartclear,name="myhome_cartclear"),
    # 购物车删除
    url(r'^cart/delete/(?P<gid>[0-9]+)/$',  views.cartdelete,name="myhome_cartdelete"),
    # 购物车编辑数量
    url(r'^cart/edit/$',  views.cartedit,name="myhome_cartedit"),


    # 订单确认
    url(r'^order/confirm/$', views.orderconfirm,name="myhome_orderconfirm"),
    # 订单生成
    url(r'^order/create/$', views.ordercreate,name="myhome_ordercreate"),
    # 支付页面
    url(r'^order/buy/(?P<oid>[0-9]+)/$',views.orderbuy,name="myhome_orderbuy"),
    # 支付成功
    url(r'^order/success/(?P<oid>[0-9]+)/$',views.orderbuysuccess,name="myhome_orderbuysuccess"),


    # 个人中心 我的订单
    url(r'^myorder/$',views.myorder,name="myhome_myorder"),
    # 我的信息
    url(r'^myorder/myselfset/$',views.myselfset,name="myhome_myselfset"),
    # 更新信息
    url(r'^myorder/myupdate/$',views.myupdate,name="myhome_myupdate"),


    # 地址管理
    url(r'^myorder/myaddress/$',views.myaddress,name="myhome_myaddress"),
    # 添加收货地址
    url(r'^address/insert/$', views.addressinsert,name="myhome_addressinsert"),
    # 删除地址
    url(r'^address/delete/$',views.addressdelete,name="myhome_addressdelete"),
    # 修改地址
    url(r'^address/edit/$',views.addressedit,name="myhome_addressedit"),
    # 更新地址
    url(r'^address/update/$',views.addressupdate,name="myhome_addressupdate"),





]

